package com.springbootquartz.Job_Test;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @author rise
 * @date 2024年11月01日 14:25
 */
@Slf4j
@Data
public class PlayGameJob2 implements Job {
    private String gameName;
    private float gamePrice;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // 获取JobDataMap，该Map在创建JobDetail的时候设置的
        System.out.println("我玩的" + gameName + "才花费了我" + gamePrice + "块钱");
        log.info("我玩的{}才花费了{}块钱", gameName, gamePrice);
    }
}
